// Copyright personal possession of Nguyen Minh Kha
// Datetime: 05:33PM 09/27/2011
// Discription: This class manage all game controlable object.
// Licencse: Free source
// Version: 1.0
// Writer: Nguyen Minh Kha

/* Google opensource coding standard with variable name exception */

#ifndef GAMEFRAMEWORK_CONTROLLABLE_MANAGER_H_
#define GAMEFRAMEWORK_CONTROLLABLE_MANAGER_H_

#include <Windows.h>

#include "controllable_object.h"

class ControllableManager
{
  /* Struct */
private:
  struct List{
    ControllableObject *object;
    List *pNext;
  };
  /*Static*/

  static ControllableManager* thisPointer;
public:
  static ControllableManager* getInstance() {
    return ControllableManager::thisPointer;}
  /* Constructor; Destructor */
public:
  ControllableManager(void);
  ~ControllableManager(void);

  /* Method */

public:
  void Controls(bool key_down, int key_code);
  
  void Add(ControllableObject *object);
  void Delete(ControllableObject *object);
  void RemoveAll();

  // Controllable object loop in thread.
  void Threading();

  /* Data member */

private:
  List* pHead;
};

#endif // GAMEFRAMEWORK_CONTROLLABLE_MANAGER_H_

